﻿using System.Linq;
using Framework.Exceptions;
using Interfaces.Validation.Repositories;

namespace SQLRepositories.ValidationRepository
{
    public class NewsValidationRepository : BaseRepository, INewsValidationRepository
    {
        public NewsValidationRepository(IDBEconomicInformationServiceContext context) 
            : base(context){}

        public bool IsFeedExists(string url)
        {
            return ExceptionHandlingManager.Process(() => Context.Feeds.Any(x => x.BaseUri.Equals(url)), PolicyNames.DASPolicy);
        }
    }
}
